// https://umijs.org/config/
import { defineConfig } from 'umi';
import { join } from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;
export default defineConfig({
  hash: true,
  antd: {},
  dva: {
    hmr: true,
  },
  layout: {
    // https://umijs.org/zh-CN/plugins/plugin-layout
    locale: true,
    siderWidth: 208,
    ...defaultSettings,
  },
  dynamicImport: {
    loading: '@ant-design/pro-layout/es/PageLoading',
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
  routes,
  // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  // esbuild is father build tools
  // https://umijs.org/plugins/plugin-esbuild
  esbuild: {},
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
  theme: {
    '@select-color': '#355fb8',
    '@run-color': '#4FD97B',
    '@alarm-color': '#f4b766',
    '@fault-color': '#666666',
    '@no-on-color': '#B0ADAD',
    '@border-line-color': '#136bb6',
    '@plate-bg':'rgba(27,59,138)',
    '@border-color': '#126cbb',
    '@btn-bg': '#07a7ff', 
    '@btn1-bg': '#2dcbe4',
    '@btn2-bg': '#ea69aa',
    
  },
  // Fast Refresh 热更新
  fastRefresh: {},
  openAPI: [
    {
      requestLibPath: "import { request } from 'umi'",
      schemaPath: join(__dirname, './openapi/oneapi.json'),
      projectName: 'oneapi',
      mock: false,
    },
    {
      requestLibPath: "import { request } from 'umi'",
      schemaPath: join(__dirname, './openapi/twoapi.json'),
      projectName: 'twoapi',
      mock: false,
    },
  ],
  nodeModulesTransform: {
    type: 'none',
  },
  //mfsu: {},
  webpack5: {},
  exportStatic: {},
  request: {
    dataField: '',
  },
});
